package com.boarsoft.message.amq;

import javax.annotation.PostConstruct;

import org.apache.activemq.broker.BrokerService;

/**
 * TODO 以API方式启动内嵌的ActiveMQ Broker
 * 
 * @author Mac_J
 *
 */
public class EmbeddedActiveMQBroker {

	@PostConstruct
	public void init() throws Exception {
		BrokerService broker = new BrokerService();
		// TransportConnector connector = new TransportConnector();
		// connector.setUri(new URI("tcp://localhost:61616"));
		// broker.addConnector(connector);
		// broker.addConnector("tcp://localhost:61616");
		broker.addConnector("amqp://192.168.1.15:5672");
		broker.setPersistent(false);
		broker.start();
	}
}
